package com.gklyj.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gklyj.pojo.Position;
import com.gklyj.pojo.Zixun;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface zixunMapper extends BaseMapper<Zixun> {

    //列出招聘单位发布的资讯
    @Select("select * from zixun where u_name !='admin'")
    List<Zixun> findListNoAdmin();

    //列出管理员自身发布的资讯
    @Select("select * from zixun where u_name ='admin'")
    List<Zixun> findListAdmin();

    //管理员根据条件查找招聘单位资讯信息
    List<Zixun> ZpSearchZixun(Zixun zixun);

    //管理员根据条件查找管理员资讯信息
    List<Zixun> AdSearchZixun(Zixun zixun);

    //不同招聘单位，登陆后列出对应的资讯信息
    @Select("select * from Zixun where department = #{department}")
    List<Zixun> ListThisGonggao(String department);

    //招聘单位可以条件查询相应的资讯信息
    List<Zixun> SearchThisGonggao(Zixun zixun);

    //统计各月的资讯数量
    Integer getZixunNumberByTime(String time);

    //求所有资讯数量
    @Select("select count(*) from zixun")
    Integer getZixunNumber();

    //求某天资讯发布数量
    @Select("select count(*) from zixun where time = #{time}")
    Integer getOneDayZixunNumber(String time);

    //列出某招聘单位发布的资讯
    @Select("select * from zixun where department = #{department}")
    List<Zixun> findOneDepartmentZixunList(String department);

}
